//
//  MCNavigationController.swift
//  WisdomSpace
//
//  Created by goulela on 2017/8/29.
//  Copyright © 2017年 MC. All rights reserved.
//

import UIKit

class MCNavigationController: UINavigationController,UIGestureRecognizerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        let navBar = UINavigationBar.appearance()
        
        navBar.titleTextAttributes = [NSAttributedStringKey.font : MCFont(19.0),NSAttributedStringKey.foregroundColor : UIColor.MCBlack]
        navBar.isTranslucent = false
        
        navBar.setBackgroundImage(UIImage.init(named: "Nav_background"), for: UIBarMetrics.default)
    
        self.interactivePopGestureRecognizer?.delegate = self
    }
    
    func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        if gestureRecognizer == self.interactivePopGestureRecognizer {
            if self.visibleViewController == self.viewControllers[0] {
                // 让第一个子控制器侧滑不产生效果
                return false
            }
        }
        return true
    }
}






